hibernate: Disable when securelevel is set
authorJosh Boyer <jwboyer@fedoraproject.org>
Fri, 20 Jun 2014 12:53:24 +0000 (08:53 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 4 Jan 2017 19:39:36 +0000 (19:39 +0000)
There is currently no way to verify the resume image when returning
from hibernate.  This might compromise the securelevel trust model,
so until we can work with signed hibernate images we disable it in
a secure modules environment.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name hibernate-disable-when-securelevel-is-set.patch

kernel/power/hibernate.c

index 33c79b6105c55fdc4f228bb0348fbc2b92d68f0f..5a3bf6aec0e735d538ac5647e852f42f6b7a2a0c 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/ctype.h>
 #include <linux/genhd.h>
 #include <linux/ktime.h>
+#include <linux/security.h>
 #include <trace/events/power.h>
 
 #include "power.h"
@@ -67,7 +68,7 @@ static const struct platform_hibernation_ops *hibernation_ops;
 
 bool hibernation_available(void)
 {
-       return (nohibernate == 0);
+       return ((nohibernate == 0) && (get_securelevel() <= 0));
 }
 
 /**